package com.mzj.saas.mservice.sys.controller;

import com.mzj.saas.annotation.RepeatSubmit;
import com.mzj.saas.commons.ResultBean;
import com.mzj.saas.mservice.sys.service.WechatAccountService;
import com.mzj.saas.mservice.sys.vo.WechatAccountVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/*
*商户号设置
 */
@Controller
@RequestMapping("/wechat/account")
public class WechatAccountController {
    private static final Logger LOG = LoggerFactory.getLogger(WechatAccountController.class);
    @Autowired
    private WechatAccountService wechatAccountService;
    /*
    *商户号信息显示
     */
    @PostMapping("showInfo")
    @ResponseBody
    public ResultBean<Object> showInfo(@RequestHeader String accessToken) {
      return wechatAccountService.showInfo(accessToken);
    }
    /*
    *商户号新增/修改
     */
    @PostMapping("addOrUpdateInfo")
    @RepeatSubmit
    @ResponseBody
    public ResultBean<Object> addOrUpdateInfo(@RequestHeader String accessToken, WechatAccountVO wechatAccountVO, @RequestParam(required = false) MultipartFile file) {
        return wechatAccountService.addOrUpdateInfo(accessToken,wechatAccountVO,file);
    }
}
